﻿using FTBS.Models.DAO;
using FTBS.Models.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace FTBS.Models.BLO
{
    public class TheaterBLO
    {
        private TheaterDAO _theaterDao = new TheaterDAO();
        private UserDAO _userDao = new UserDAO();

        /// <summary>
        /// Get All Information Of Theater
        /// </summary>
        /// <returns>List of Theater</returns>
        /// <author>VuongVT</author>
        public List<Theater> GetAllTheaterInfo()
        {
            return _theaterDao.GetAllTheaterInfo();
        }

         /// <summary>
        /// Get Theater by Id
        /// </summary>
        /// <param name="theaterId"></param>
        /// <returns></returns>
        public Theater GetTheaterById(int theaterId)
        {
            return _theaterDao.GetTheaterById(theaterId);
        }

        /// <summary>
        /// Check exist TheaterName
        /// </summary>
        /// <param name="theater"></param>
        /// <returns>true: Exist TheaterName -- false: Not Exist TheaterName</returns>
        public bool IsExistTheater(Theater theater)
        {
            return _theaterDao.IsExistTheater(theater);
        }

        /// <summary>
        /// Create a new Theater
        /// </summary>
        /// <param name="theater"></param>
        /// <returns>1: success -- 0: fail</returns>
        public int CreateTheater(Theater theater)
        {
            return _theaterDao.CreateTheater(theater);
        }

        /// <summary>
        /// Edit a Theater
        /// </summary>
        /// <param name="theater"></param>
        /// <returns>1: Success --- 0: Fail</returns>
        public int EditTheater(Theater theater)
        {
            return _theaterDao.EditTheater(theater);
        }       

        /// <summary>
        /// Delete a Theater
        /// </summary>
        /// <param name="theater"></param>
        /// <returns>1: Success --- 0: Fail</returns>
        public int DeleteTheater(Theater theater)
        {
            return _theaterDao.DeleteTheater(theater);
        }

        /// <summary>
        /// Get All Supplier
        /// </summary>
        /// <returns>List of Supplier</returns>
        public IEnumerable<User> GetAllSupplier()
        {
            return _userDao.GetAllSupplier();
        }
    }
}